{include file="common:head" /}

<style>
    .name {
        width: 18em; /*保证文字不会被半汉字截断,显示10个文字*/
        /*overflow: hidden; !*超出长度的文字隐藏*!*/
        text-overflow: ellipsis; /*文字隐藏以后添加省略号*/
        /*white-space: nowrap; !*强制不换行*!*/
    }

    .des {
        width: 18em; /*保证文字不会被半汉字截断,显示10个文字*/
        /*overflow: hidden; !*超出长度的文字隐藏*!*/
        text-overflow: ellipsis; /*文字隐藏以后添加省略号*/
        /*white-space: nowrap; !*强制不换行*!*/
        color: #000000;
    }
    .pagina ul li {
        display: inline-block;
        width: 32px;
        height: 32px;
        line-height: 32px;
        text-align: center;
        color: #386ed3;
        background: #fff;
        border: 1px solid #afc5ed;
    }
    .pagina {
        /*margin-top: 20px;*/
        text-align: center;
        position: absolute;
        margin-top: -215px;
        margin-left: 689px;
    }
</style>


<body>
<div class="index-content">
    <!-- 头部 -->

    {include file="common:header" /}
    <style>
        .slideTxtBox .hd ul li.on{
            height: 25px;
            background: #dcb77d;
            /*border-bottom: 2px solid #000;*/
            color: #fff;
            display: inline-block;
        }
        .slideTxtBox .hd ul li{
            color: #000000;
            padding: 4px 28px;
            border: 2px solid #dcb77d;
            display: inline-block;
            margin: 0 15px 0 0;
            height: 25px;
            line-height: 26px;
            width: 102px;
        }
    </style>
    <!-- 当季热销车 -->
    <img src="/static/index/img/cxt.jpg" alt="" width="100%">
    <div class="hot-carbuy width1300 ">
<!--        <div class="title">车型展示</div>-->


        <div class="car-style clearfix slideTxtBox">
            <div class="hd" style="height: 30px;line-height: 30px;position: relative;display: inherit;margin-bottom: 58px;">
                <ul style="float: left;position: absolute;top: -1px;height: 32px;list-style: none;white-space: nowrap;text-align: center;padding-left: 17px;width: 1200px;">
                    {foreach $cartype as $votype}
                    <li>{$votype.name}</li>
                    {/foreach}
                </ul>
            </div>
            <div class="car-style-left">
                <!-- 二级菜单 -->
                <ul class="second-classify" style="margin-bottom: 18px;border: 1px solid #d8d8d8;">
                    <li class="clearfix"  style="clear: both;height: 50px;line-height: 50px;padding: 0 10px;cursor: pointer;border-bottom: 1px dotted #d8d8d8;"><a target="_blank" href="/about?id=7&about='公司动态'"><img src="__STATIC__/index/img/type1.png" style="float:left;width: 20px;margin-top: 17px;margin-right: 5px;" />公司动态<span class="iconfont icon-xiangyou"></span></a></li>
                    <li class="clearfix" style="clear: both;height: 50px;line-height: 50px;padding: 0 10px;cursor: pointer;border-bottom: 1px dotted #d8d8d8;"><a target="_blank" href="/article/index"><img src="__STATIC__/index/img/type2.png"  style="float:left;width: 20px;margin-top: 17px;margin-right: 5px;" />优惠资讯<span class="iconfont icon-xiangyou"></span></a></li>
                    <li class="clearfix" style="clear: both;height: 50px;line-height: 50px;padding: 0 10px;cursor: pointer;border-bottom: 1px dotted #d8d8d8;"><a target="_blank" href="/about?id=18&about='常见问题'">
                        <img src="__STATIC__/index/img/type3.png" style="float:left;width: 20px;margin-top: 17px;margin-right: 5px;"  />常见问题<span class="iconfont icon-xiangyou"></span>
                    </a>
                    </li>

                    <li class="clearfix" style="clear: both;height: 50px;line-height: 50px;padding: 0 10px;cursor: pointer;border-bottom: 1px dotted #d8d8d8;"><a target="_blank" href="/video/index"><img src="__STATIC__/index/img/type4.png"  style="float:left;width: 20px;margin-top: 17px;margin-right: 5px;" />视频中心<span class="iconfont icon-xiangyou"></span></a></li>
                </ul>
                <div class="discount-msg">
                    <div class="h3title">
                        <img src="/static/index/img/msg.png"/>
                        优惠资讯
                    </div>
                    <div class="discount-msg-all">
                        {foreach $alist as $key=>$vo }
                        <div class="discount-msg-list clearfix"
                             onclick="openwin('{:url(\'index/article/detail\')}' + '?id=' + {$vo.id})">
                            <img src="{$vo.image}"/>
                            <div class="discount-msg-right">
                                <h4>{$vo.title}</h4>
                                <p>{$vo.create_time|date="Y-m-d"}</p>
                            </div>
                        </div>
                        {/foreach}

                    </div>
                </div>
            </div>

            <div class="hot-content fr clearfix bd" style="">
                {foreach $list as $v}
                <ul>
                     <if condition='$v neq ""'>
                        {foreach $v as $val}
                        <li>
                            <div class="hot-list fl" onclick="openwin('{:url(\'index/lists/detail\')}' + '?id=' + {$val.id})">
                                <div class="img-box">
                                    <img src="{$val.w_img}"/>
                                </div>
                                <div class="img-box">
                                    <img src="{$val.z_img}"/>
                                </div>
            <!--                    <p class="name">{$val.title}</p>-->
                                <p class="des">{$val.title}</p>

                            </div>
                        </li>
                    {/foreach}
                     </if>
                </ul>
                {/foreach}

            </div>

        </div>
        <script type="text/javascript">jQuery(".slideTxtBox").slide();</script>
<!--        <div class="pagina">-->
<!--            <div class="page">-->

<!--            </div>-->
<!--        </div>-->
    </div>

    <!-- 底部 -->
    {include file="common:footer" /}

</div>
<!--<script type="text/javascript" src="/static/index/js/jquery-3.2.1.min.js"></script>-->
<script type="text/javascript" src="/static/index/js/swiper.min.js"></script>
<!--<script type="text/javascript" src="/static/index/js/common.js"></script>-->
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script type="text/javascript" src="__STATIC__/index/js/header_move.js"></script>

<script type="text/javascript">
    var carSelectArr = [];
    var array = [];
    var params = {};

    $(".car-classify").on("click", ".car-classify-list", function (e) {
        // console.log(131)
        stopDefault()
        $(this).find("ul").toggle()
    })
    // 点击选择的分类列表
    $(".car-classify ul").on("click", "li", function (e) {
        stopBubble()
        console.log(249)
        var index = $(this).parents(".car-classify-list").index();
        carSelectArr[index] = $(this).text()

        var html = '';
        for (var i = 0; i < carSelectArr.length; i++) {
            var textcar = carSelectArr[i] ? carSelectArr[i] : '';
            if (textcar) {
                html += '<li>' + textcar + '<i class="iconfont icon-2guanbi"></i></li>'
            }


        }
        $(".selcet-car-show").html(html);
        $(".car-style .car-style-left .select-car .car-type-show").show();
        var search_text = $(this).text();
        searchLish(index, search_text);
    })
    // 点击删除
    $(".hot-carbuy .car-style-left .select-car .selcet-car-show").on("click", "li i", function () {
        console.log(carSelectArr)
        var carText = $(this).text();
        console.log($(this))
        var carIndex;
        carSelectArr[i] = '';
        console.log(carSelectArr)
        $(this).parent("li").hide();

    })
    // 清除全部
    $(".clearAll").click(function () {
        carSelectArr = [];
        $(".car-type-show").hide();
        params = {};
        searchLish('', '');
    })
    // var swiper = new Swiper('.swiper-container', {
    // 	autoplay:true,
    // 	navigation: {
    // 		nextEl: '.swiper-button-next',
    // 		prevEl: '.swiper-button-prev',
    // 	},
    // });
    // var swiper2 = new Swiper('.evaluation-container', {
    // 	slidesPerView: 4,
    // 	spaceBetween: 7
    // });
    // $(".car-classify").on(".car-classify-list","click",function(){
    //     console.log(130)
    //     $(this).find("ul").show();
    //     // $(this).siblings().find("ul").hide();
    // })


    function searchLish(key, value = '') {

        var url1 = "index/lists/search";

        var title = '';
        var jiage = '';
        var pailiang = '';
        var qudong = '';

        if (key == 0 && value !== 'undefined') {
            title = value;
            Object.assign(params, {title: title})
        }
        if (key == 1 && value !== 'undefined') {
            jiage = value;
            Object.assign(params, {jiage: jiage})
        }
        if (key == 2 && value !== 'undefined') {
            pailiang = value;
            Object.assign(params, {pailiang: pailiang})
        }
        if (key == 3 && value !== 'undefined') {
            qudong = value
            Object.assign(params, {qudong: qudong})
        }


        _axios(url1, params)
    }
</script>
</body>
</html>
